Fixes for stmwpp.cc in NEW_STRINGS.
authorrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 24 Nov 2013 02:54:38 +0000 (02:54 +0000)
committerrobertlipe <robertlipe@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 24 Nov 2013 02:54:38 +0000 (02:54 +0000)
gpsbabel/stmwpp.cc

index 303a2cdbb8d1781d6ed837d4f41e334e46026e61..0cbd2531aa5d3d42173f514c16d99ce5a3347a5c 100644 (file)
@@ -135,7 +135,11 @@ stmwpp_data_read(void)
         break;
 
       case 2:
+#if NEW_STRINGS
+        wpt->shortname = QString::fromLatin1(c);
+#else
         wpt->shortname = xstrdup(c);
+#endif
         break;
 
       case 3:
@@ -246,8 +250,8 @@ stmwpp_waypt_cb(const waypoint* wpt)
   snprintf(cdate, sizeof(cdate), "%02d/%02d/%04d", tm.tm_mon, tm.tm_mday, tm.tm_year);
   snprintf(ctime, sizeof(ctime), "%02d:%02d:%02d", tm.tm_hour, tm.tm_min, tm.tm_sec);
 
+  String sn;
   switch (what) {
-    char* sn;
 
   case STM_WAYPT:
   case STM_RTEPT:
@@ -256,8 +260,11 @@ stmwpp_waypt_cb(const waypoint* wpt)
     } else {
       sn = mkshort(short_h, wpt->shortname);
     }
-    gbfprintf(fout, "WP,D,%s,", sn);
+    gbfprintf(fout, "WP,D,%s,", CSTRc(sn));
+#if NEW_STRINGS
+#else
     xfree(sn);
+#endif
     break;
 
   case STM_TRKPT: